package com.learning.rpc.common.serialize;

/**
 * ClassName: Serialization
 * Description:
 * Date: 2022/5/10 22:04 【需求编号】
 *
 * @author Sam Sho
 * @version V1.0.0
 */
public interface Serialization {

    /**
     * 序列化
     *
     * @param output
     * @return
     * @throws Exception
     */
    byte[] serialize(Object output) throws Exception;

    /**
     * 反序列化
     *
     * @param input
     * @param clazz
     * @return
     * @throws Exception
     */
    Object deserialize(byte[] input, Class clazz) throws Exception;
}
